<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<!--		<link rel="stylesheet" type="text/css" href="css/style.css" />-->
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>后台管理</title>

		<meta name="description" content="" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

		<!-- bootstrap & fontawesome -->
		<link rel="stylesheet" href="assets/css/bootstrap.min.css" />
		<script src="assets/js/bootstrap.min.js"></script>
		<link rel="stylesheet" href="assets/font-awesome/4.5.0/css/font-awesome.min.css" />
		<script src="assets/js/jquery-2.1.4.min.js"></script>
		<!-- page specific plugin styles -->

		<!-- text fonts -->
		<link rel="stylesheet" href="assets/css/fonts.googleapis.com.css" />

		<!-- ace styles -->
		<link rel="stylesheet" href="assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" />

		<!--[if lte IE 9]>
		<link rel="stylesheet" href="assets/css/ace-part2.min.css" class="ace-main-stylesheet" />
		<![endif]-->
		<link rel="stylesheet" href="assets/css/ace-skins.min.css" />
		<link rel="stylesheet" href="assets/css/ace-rtl.min.css" />

		<!--[if lte IE 9]>
		<link rel="stylesheet" href="assets/css/ace-ie.min.css" />
		<![endif]-->

		<!-- inline styles related to this page -->

		<!-- ace settings handler -->
		<script src="assets/js/ace-extra.min.js"></script>

		<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

		<!--[if lte IE 8]>
		<script src="assets/js/html5shiv.min.js"></script>
		<script src="assets/js/respond.min.js"></script>
		<![endif]-->
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!--		<link rel="stylesheet" type="text/css"-->
<!--			href="css/style.css" />-->
	</head>


	<body class="no-skin">
	<div id="navbar" class="navbar navbar-default          ace-save-state"style="margin-top:0px ">
		<div class="navbar-container ace-save-state" id="navbar-container">
			<button type="button" class="navbar-toggle menu-toggler pull-left" id="menu-toggler" data-target="#sidebar">
				<span class="sr-only">Toggle sidebar</span>

				<span class="icon-bar"></span>

				<span class="icon-bar"></span>

				<span class="icon-bar"></span>
			</button>

			<div class="navbar-header pull-left">
				<a href="index.html" class="navbar-brand">
					<small>
						<i class="fa fa-leaf"></i>
						华夏医院管理后台
					</small>
				</a>
			</div>


		</div><!-- /.navbar-container -->
	</div>

	<div class="main-container ace-save-state" id="main-container">
		<script type="text/javascript">
			try{ace.settings.loadState('main-container')}catch(e){}
		</script>

		<div id="sidebar" class="sidebar                  responsive                    ace-save-state">
			<script type="text/javascript">
				try{ace.settings.loadState('sidebar')}catch(e){}
			</script>

			<div class="sidebar-shortcuts" id="sidebar-shortcuts">
				<div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
					<button class="btn btn-success">
						<i class="ace-icon fa fa-signal"></i>
					</button>

					<button class="btn btn-info">
						<i class="ace-icon fa fa-pencil"></i>
					</button>

					<button class="btn btn-warning">
						<i class="ace-icon fa fa-users"></i>
					</button>

					<button class="btn btn-danger">
						<i class="ace-icon fa fa-cogs"></i>
					</button>
				</div>

				<div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
					<span class="btn btn-success"></span>

					<span class="btn btn-info"></span>

					<span class="btn btn-warning"></span>

					<span class="btn btn-danger"></span>
				</div>
			</div><!-- /.sidebar-shortcuts -->

			<ul class="nav nav-list">
				<li class="">
					<a href="index.html">
						<i class="menu-icon fa fa-tachometer"></i>
						<span class="menu-text"> 医院主页 </span>
					</a>

					<b class="arrow"></b>
				</li>

				<li class="">
					<a href="#" class="dropdown-toggle">
						<i class="menu-icon fa fa-desktop"></i>
						<span class="menu-text">
								管理服务
							</span>

						<b class="arrow fa fa-angle-down"></b>
					</a>

					<b class="arrow"></b>

					<ul class="submenu">


						<li class="">
							<a href="typography.html">
								<i class="menu-icon fa fa-caret-right"></i>
								医生管理
							</a>

							<b class="arrow"></b>
						</li>

						<li class="">
							<a href="elements.html">
								<i class="menu-icon fa fa-caret-right"></i>
								患者管理
							</a>

							<b class="arrow"></b>
						</li>

						<li class="">
							<a href="elements.html">
								<i class="menu-icon fa fa-caret-right"></i>
								病例管理
							</a>

							<b class="arrow"></b>
						</li>

						<li class="">
							<a href="elements.html">
								<i class="menu-icon fa fa-caret-right"></i>
								科室管理
							</a>

							<b class="arrow"></b>
						</li>
					</ul>
				</li>

				<li class="">
					<a href="#" class="dropdown-toggle">
						<i class="menu-icon fa fa-list"></i>
						<span class="menu-text"> 学习库 </span>

						<b class="arrow fa fa-angle-down"></b>
					</a>

					<b class="arrow"></b>

					<ul class="submenu">
						<li class="">
							<a href="tables.html">
								<i class="menu-icon fa fa-caret-right"></i>
								药物库
							</a>

							<b class="arrow"></b>
						</li>

						<li class="">
							<a href="jqgrid.html">
								<i class="menu-icon fa fa-caret-right"></i>
								器械库
							</a>

							<b class="arrow"></b>
						</li>
					</ul>
				</li>

				<li class="">
					<a href="#" class="dropdown-toggle">
						<i class="menu-icon fa fa-pencil-square-o"></i>
						<span class="menu-text"> 出诊排班 </span>

						<b class="arrow fa fa-angle-down"></b>
					</a>

					<b class="arrow"></b>

					<ul class="submenu">
						<li class="">
							<a href="form-elements.html">
								<i class="menu-icon fa fa-caret-right"></i>
								查询出诊
							</a>

							<b class="arrow"></b>
						</li>

						<li class="">
							<a href="form-elements-2.html">
								<i class="menu-icon fa fa-caret-right"></i>
								调整出诊
							</a>

							<b class="arrow"></b>
						</li>

					</ul>
				</li>

				<li class="">
					<a href="widgets.html">
						<i class="menu-icon fa fa-list-alt"></i>
						<span class="menu-text"> 智能诊疗方案 </span>
					</a>

					<b class="arrow"></b>
				</li>

			</ul>
		</div>



		<div class="row">
			<div class="col-xs-12">
				<!-- PAGE CONTENT BEGINS -->

				<!-- PAGE CONTENT ENDS -->
			</div><!-- /.col -->
		</div><!-- /.row -->
	</div><!-- /.page-content -->

	<div class="page-content"style="position:absolute;margin-left: 700px;margin-top: -220px;border: 1px solid #ccc; border-radius: 16px;font-family:Helvetica Neue" id="wrap">
		<div class="row">
			<div class="col-xs-12">
				<div id="content">
					<p id="whereami">
					</p>
					<h1 style="margin-left: 40px">
						更新医生信息
					</h1>
					<form action="doctorList.html" method="post">
						<table cellpadding="0" cellspacing="0" border="0"
							   class="form_table">
							<tr>
								<td valign="middle" align="right">
									医生编号:
								</td>
								<td valign="middle" align="left">
									{{emp.id}}
								</td>
							</tr>

							<tr>
								<td valign="middle" align="right">
									医生名字:
								</td>
								<td valign="middle" align="left">
									<input type="text" class="inputgri form-control" v-model="emp.name"/>
								</td>
							</tr>
							<tr>
								<td valign="middle" align="right">
									医生电话:
								</td>
								<td valign="middle" align="left">
									<input type="text" class="inputgri form-control" v-model="emp.tel"/>
								</td>
							</tr>
							<tr>
								<td valign="middle" align="right">
									医生年龄:
								</td>
								<td valign="middle" align="left">
									<input type="text" class="inputgri form-control" v-model="emp.age"/>
								</td>
							</tr>
							<tr>
								<td valign="middle" align="right">
									医生性别:
								</td>
								<td valign="middle" align="left">
									<input type="text" class="inputgri form-control" v-model="emp.sex"/>
								</td>
							</tr>
							<tr>
								<td valign="middle" align="right">
									所在部门:
								</td>
								<td valign="middle" align="left">
<!--									<input type="text" class="inputgri form-control" v-model="emp.department"/>-->
									<select name="plan" id="plan" v-model="emp.department">
										<option value="内科">内科</option>
										<option value="脑外科">脑外科 </option>
										<option value="肿瘤">肿瘤</option>
										<option value="耳鼻咽喉科">耳鼻咽喉科</option>
										<option value="骨科">骨科</option>
										<option value="妇产科">妇产科</option>
										<option value="皮肤科">皮肤科</option>
										<option value="神经内科">神经内科</option>
										<option value="整形外科">整形外科</option>
										<option value="精神病">精神病</option>
										<option value="口腔科">口腔科</option>
										<option value="儿科">儿科</option>
										<option value="泌尿科">泌尿科</option>
										<option value="外科">外科</option>
										<option value="传染病">传染病</option>
										<option value="眼科">眼科</option>
										<option value="妇科">妇科</option>
										<option value="男科">男科</option>
										<option value="烧伤科">烧伤科</option>
									</select>


								</td>
							</tr>
							<tr>
								<td valign="middle" align="right">
									身份证:
								</td>
								<td valign="middle" align="left">
									<input type="text" class="inputgri form-control" v-model="emp.id_card"/>
								</td>
							</tr>
							<tr>
								<td valign="middle" align="right">
									密码:
								</td>
								<td valign="middle" align="left">
									<input type="text" class="inputgri form-control" v-model="emp.password"/>
								</td>
							</tr>
						</table>
						<p>
							<input type="button" @click="editEmp" class="button" value="提交" style="margin-left:120px;margin-top: 40px"/>
						</p>
					</form>
				</div>
			</div>

			</div>
		</div>
		<div class="row">
	</div>








	<div class="footer">
		<div class="footer-inner">
			<div class="footer-content">
				<div id="footer">
					<div id="footer_bg">
						Copyright © 小凡哥 All rights reserved.
						li123fan00@foxmail.com
					</div>
				</div>

				&nbsp; &nbsp;
				<span class="action-buttons">
							<a href="#">
								<i class="ace-icon fa fa-twitter-square light-blue bigger-150"></i>
							</a>

							<a href="#">
								<i class="ace-icon fa fa-facebook-square text-primary bigger-150"></i>
							</a>

							<a href="#">
								<i class="ace-icon fa fa-rss-square orange bigger-150"></i>
							</a>
						</span>
			</div>
		</div>
	</div>

	<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
		<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
	</a>
	</div><!-- /.main-container -->

	<!-- basic scripts -->

	<!--[if !IE]> -->


	<!-- <![endif]-->

	<!--[if IE]>

	<![endif]-->
	<script type="text/javascript">
		if('ontouchstart' in document.documentElement) document.write("<script src='assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
	</script>


	<!-- page specific plugin scripts -->

	<!-- ace scripts -->
	<script src="assets/js/ace-elements.min.js"></script>
	<script src="assets/js/ace.min.js"></script>

	<!-- inline scripts related to this page -->

	</body>


</html>
<script src="/es_healthy/js/vue.js"></script>
<script src="/es_healthy/js/axios.min.js"></script>
<script>
	var app = new Vue({
		el:"#wrap",
		data:{
			user:{}, //存放登陆的用户信息

			emp:{}
		},
		methods:{
			logout(){
				localStorage.removeItem("admin");
				//刷新页面
				location.reload(true);
			},
			//修改信息
			editEmp(){
				console.log(this.emp);
				//获取文件信息
				var formData = new FormData();
				formData.append("id",this.emp.id);
				formData.append("name",this.emp.name);
				formData.append("tel",this.emp.tel);
				formData.append("sex",this.emp.sex);
				formData.append("age",this.emp.age);
				formData.append("department",this.emp.department);
				formData.append("id_card",this.emp.id_card);
				formData.append("password",this.emp.password);
				var _this = this;
				//文件上传时  请求方式必须是post  enctype必须为multipart-data
				axios({
					method:"post",
					url:"http://localhost:8080/es_healthy/admin/updateDoctor",
					data:formData,
					headers:{
						'content-type':'multipart/form-data'
					}
				}).then(res=>{
					console.log(res.data);
					if(res.data.state){
						if(window.confirm(res.data.msg+"点击确定跳转至列表页面！")){
							location.href="/es_healthy/doctorList.html";
						}
					}else
					{
						alert(res.data.msg);
					}
				});
			}
		},
		created(){
			var userString = localStorage.getItem("manager");

			if(userString)
			{
				//将JSON转化为user对象
				this.user=JSON.parse(userString);
			}else{
				alert("您尚未登陆,点击确定跳转至登陆页面");
				location.href="/es_healthy/loginAdmin.html";
			}

			//获取对应id信息
			var start = location.href.lastIndexOf("=");
			var id =location.href.substring(start+1);
			console.log(id);
			var _this = this;

			//查询一个人信息
			axios.get("http://localhost:8080/es_healthy/admin/findDoctor?id="+id+"&token="+sessionStorage.getItem("token")).then(res=>{
				console.log(res.data);
				_this.emp = res.data;
			});


		}
	});
</script>